package com.richapp.launcher.serialport.gateway;

import java.util.HashMap;
import java.util.Map;


public class GatewaytConstant {
	
	/**
	 * 串口驱动常量
	 */
	public static final String SERIAL_PORT_DRIVER_NAME = "serial_port";
	
	/**
	 * 设备类型集合
	 */
	private static Map<String,String> DEVICE_TYPE_MAP = null;
	
	/**
	 * 监控设备类型集合
	 */
	private static Map<String,String> DEVICE_MONITOR_MAP = null;

    /**
     * 多路设备类型集合
     */
	private static Map<String,String> MUILTIWAY_TYPE_MAP = null;

	/**
	 * 底层指令协议常量字节长度
	 */
	//同步码
	public static final int LENGTH_PACKAGE_HEAD = 1;
	public static final String INSTRUCTION_HEAD = "FF";
	//包长
	public static final int LENGTH_PACKAGE_LENGTH = 2;
	//设备编号
	public static final int LENGTH_ID = 1;
	//设备编号
	public static final int LENGTH_NO = 2; //多路设备1byte编号,1byte路数
	//添加设备动作
	public static final int LENGTH_ADD_MACHINE = 2;
	//复位设备动作
	public static final int LENGTH_RESET_MACHINE = 1;
	//升级设备动作
	public static final int LENGTH_UPDATE_MACHINE = 1;
	//操作设备动作 开、关、调整
	public static final int LENGTH_CHANGE_MACHINE = 1;
	//设备状态调整动作
	public static final int LENGTH_CHANGE_MACHINE_STATE = 1;
	//查询设备在线动作
	public static final int LENGTH_QUERY_MACHINE_ONLINE = 1;
	//读取设备信息动作
	public static final int LENGTH_QUERY_MACHINE_INFO = 1;
	//情景开关动作
	public static final int LENGTH_SCENARIO = 2;
	//校验值
	public static final int LENGTH_CHECK_VALUE = 2;
	
	//设备类型
	//普通灯
	public static final int ID_TYPE_NOMAL_LIGHT = 0x01;
	public static final String ID_TYPE_NOMAL_LIGHT_STR = "01";
	//调光灯
	public static final int ID_TYPE_DIMMING_LIGHT = 0x02;
	public static final String ID_TYPE_DIMMING_LIGHT_STR = "02";
	//灯座
	public static final int ID_TYPE_LAMP_HOLDER = 0x03;
	public static final String ID_TYPE_LAMP_HOLDER_STR = "03";
	//窗帘
	public static final int ID_TYPE_CURTAIN = 0x04;
	public static final String ID_TYPE_CURTAIN_STR = "04";
	//红外
	public static final int ID_TYPE_INFRARED = 0x05;
	public static final String ID_TYPE_INFRARED_STR = "05";
	//探测器，原二氧化碳
	public static final int ID_TYPE_CARBON_DIOXIDE = 0x06;
	public static final String ID_TYPE_CARBON_DIOXIDE_STR = "06";
	//空气质量
	public static final int ID_TYPE_AIR_QUALITY = 0x07;
	public static final String ID_TYPE_AIR_QUALITY_STR = "07";
	//PM2.5
	public static final int ID_TYPE_PM_25 = 0x08;
	public static final String ID_TYPE_PM_25_STR = "08";
	//光照
	public static final int ID_TYPE_SUN_LIGHT = 0x09;
	public static final String ID_TYPE_SUN_LIGHT_STR = "09";
	//温湿度
	public static final int ID_TYPE_TEMPERATURE_HUMIDITY = 0x0A;
	public static final String ID_TYPE_TEMPERATURE_HUMIDITY_STR = "0A";
	//可燃气报警
	public static final int ID_TYPE_ALARM_COMBUSTIBLE_GAS = 0x0B;
	public static final String ID_TYPE_ALARM_COMBUSTIBLE_GAS_STR = "0B";
	//烟感报警
	public static final int ID_TYPE_ALARM_SMOKE = 0x0C;
	public static final String ID_TYPE_ALARM_SMOKE_STR = "0C";
	//人感报警
	public static final int ID_TYPE_ALARM_PEOPLE_SENSE = 0x0D;
	public static final String ID_TYPE_ALARM_PEOPLE_SENSE_STR = "0D";
	//门锁
	public static final int ID_TYPE_DOOR_LOCK = 0x0E;
	public static final String ID_TYPE_DOOR_LOCK_STR = "0E";
	//电源
	public static final int ID_TYPE_POWER = 0x0F;
	public static final String ID_TYPE_POWER_STR = "0F";
	//开关普通
	public static final int ID_TYPE_NORMAL_SWITCH = 0x10;
	public static final String ID_TYPE_NORMAL_SWITCH_STR = "10";
	//开关调光
	public static final int ID_TYPE_DIMMING_SWITCH = 0x11;
	public static final String ID_TYPE_DIMMING_SWITCH_STR = "11";
	//风雨传感器
	public static final int ID_TYPE_SENSOR_WIND_RAIN = 0x12;
	public static final String ID_TYPE_SENSOR_WIND_RAIN_STR = "12";
	//开关报警
	public static final int ID_TYPE_ALARM_SWITCH = 0x13;
	public static final String ID_TYPE_ALARM_SWITCH_STR = "13";
	//紧急报警
	public static final int ID_TYPE_ALARM_EMERGENCY = 0x14;
	public static final String ID_TYPE_ALARM_EMERGENCY_STR = "14";
	//红外发射器
	public static final int ID_TYPE_HAND_HELD = 0x15;
	public static final String ID_TYPE_HAND_HELD_STR = "15";
	//强电窗帘
	public static final int ID_TYPE_HIGH_VOLTAGE_ELECTRICAL_CURTAIN = 0x16;
	public static final String ID_TYPE_HIGH_VOLTAGE_ELECTRICAL_CURTAIN_STR = "16";
	//门磁
	public static final int ID_TYPE_SECURITY_EQUIPMENT = 0x17;
	public static final String ID_TYPE_SECURITY_EQUIPMENT_STR = "17";
	//探测器
	public static final int ID_TYPE_CUSTOM_EQUIPMENT_01 = 0x18;
	public static final String ID_TYPE_CUSTOM_EQUIPMENT_01_STR = "18";
	//插座
	public static final int ID_TYPE_THE_SOCKET = 0x19;
	public static final String ID_TYPE_THE_SOCKET_STR = "19";

    //1路普通开关
    public static final int ID_TYPE_ONE_CASE_NORMAL_SWITCH = 0x1A;
    public static final String ID_TYPE_ONE_CASE_NORMAL_SWITCH_STR = "1A";

    //2路普通开关
    public static final int ID_TYPE_TWO_CASE_NORMAL_SWITCH = 0x1B;
    public static final String ID_TYPE_TWO_CASE_NORMAL_SWITCH_STR = "1B";

    //3路普通开关
    public static final int ID_TYPE_THREE_CASE_NORMAL_SWITCH = 0x1C;
    public static final String ID_TYPE_THREE_CASE_NORMAL_SWITCH_STR = "1C";

    //4路普通开关
    public static final int ID_TYPE_FOUR_CASE_NORMAL_SWITCH = 0x1D;
    public static final String ID_TYPE_FOUR_CASE_NORMAL_SWITCH_STR = "1D";

    //1路调光开关
    public static final int ID_TYPE_ONE_CASE_DIMMING_SWITCH = 0x1E;
    public static final String ID_TYPE_ONE_CASE_DIMMING_SWITCH_STR = "1E";

	//2路调光开关
	public static final int ID_TYPE_TWO_CASE_DIMMING_SWITCH = 0x1F;
	public static final String ID_TYPE_TWO_CASE_DIMMING_SWITCH_STR = "1F";
	
	/**
	 * 底层指令值
	 */
	//----设备升级传输
	//设备升级指令
	public static final int INSTRUCTION_UPDATE_MACHINE = 0xEF;
	public static final String INSTRUCTION_UPDATE_MACHINE_STR = "EF";
	//设备导出列表指令
	public static final int INSTRUCTION_EXPORT_MACHINE = 0xDF;
	public static final String INSTRUCTION_EXPORT_MACHINE_STR = "DF";
	//向设备发送大数据指令
	public static final int INSTRUCTION_TRANSPORT_BIG_DATA = 0xCF;
	public static final String INSTRUCTION_TRANSPORT_BIG_DATA_STR = "CF";
	
	//----复位设备
	//单个复位
	public static final int INSTRUCTION_RESET_SINGLE_MACHINE = 0x6F;
	public static final String INSTRUCTION_RESET_SINGLE_MACHINE_STR = "6F";
	//复位此类
	public static final int INSTRUCTION_RESET_THIS_KIND_MACHINE = 0xE0;
	public static final String INSTRUCTION_RESET_THIS_KIND_MACHINE_STR = "E0";
	//复位全部
	public static final int INSTRUCTION_RESET_ALL_MACHINE = 0xDF;
	public static final String INSTRUCTION_RESET_ALL_MACHINE_STR = "DF";
	
	//----窗帘控制
	//开启
	public static final int INSTRUCTION_OPEN_MACHINE = 0xFF;
	public static final String INSTRUCTION_OPEN_MACHINE_STR = "FF";
	//关闭
	public static final int INSTRUCTION_CLOSE_MACHINE = 0x00;
	public static final String INSTRUCTION_CLOSE_MACHINE_STR = "00";
	//停止
	public static final int INSTRUCTION_STOP_MACHINE = 0x3F;
	public static final String INSTRUCTION_STOP_MACHINE_STR = "3F";
	
	//----门禁控制
	//打开
	public static final int INSTRUCTION_UNLOCK_MACHINE = 0xFF;
	public static final String INSTRUCTION_UNLOCK_MACHINE_STR = "FF";
	//锁
	public static final int INSTRUCTION_LOCK_MACHINE = 0x00;
	public static final String INSTRUCTION_LOCK_MACHINE_STR = "00";
	//锁紧
	public static final int INSTRUCTION_LOCK_LOCK_MACHINE = 0x0D;
	public static final String INSTRUCTION_LOCK_LOCK_MACHINE_STR = "0D";
	
	//----返回结果
	//OK-O
	//public static final int INSTRUCTION_RESULT_OK_O = 0x4F;
	//public static final String INSTRUCTION_RESULT_OK_O_STR = "4F";
	//OK-K
	//public static final int INSTRUCTION_RESULT_OK_K = 0x4B;
	//public static final String INSTRUCTION_RESULT_OK_K_STR = "4B";
	//ERRO-E
	public static final int INSTRUCTION_RESULT_ERRO_E = 0x45;
	public static final String INSTRUCTION_RESULT_ERRO_E_STR = "45";
	//ERRO-R
	public static final int INSTRUCTION_RESULT_ERRO_R = 0x52;
	public static final String INSTRUCTION_RESULT_ERRO_R_STR = "52";
	//BUSY-B
	public static final int INSTRUCTION_DO_RESULT_BUSY_B = 0x42;
	public static final String INSTRUCTION_DO_RESULT_BUSY_B_STR = "42";
	//FIAL-F
	public static final int INSTRUCTION_DO_RESULT_FAIL_F = 0x46;
	public static final String INSTRUCTION_DO_RESULT_FAIL_F_STR = "46";
	
	
	//----信号质量
	//一格，很弱
	public static final int INSTRUCTION_SIGN_1 = 0x1F;
	public static final String INSTRUCTION_SIGN_1_STR = "1F";
	//两格，较弱
	public static final int INSTRUCTION_SIGN_2 = 0x2F;
	public static final String INSTRUCTION_SIGN_2_STR = "2F";
	//三格，较强
	public static final int INSTRUCTION_SIGN_3 = 0x3F;
	public static final String INSTRUCTION_SIGN_3_STR = "3F";
	//四格，质量优
	public static final int INSTRUCTION_SIGN_4 = 0x4F;
	public static final String INSTRUCTION_SIGN_4_STR = "4F";
	
	//----包类型
	//独立包
	public static final int INSTRUCTION_PACKAGE_TYPE_0 = 0x00;
	public static final String INSTRUCTION_PACKAGE_TYPE_0_STR = "00";
	//分包中的起始包
	public static final int INSTRUCTION_PACKAGE_TYPE_1 = 0x01;
	public static final String INSTRUCTION_PACKAGE_TYPE_1_STR = "01";
	//分包中的继续包
	public static final int INSTRUCTION_PACKAGE_TYPE_2 = 0x02;
	public static final String INSTRUCTION_PACKAGE_TYPE_2_STR = "02";
	//分包中的结束包
	public static final int INSTRUCTION_PACKAGE_TYPE_3 = 0x03;
	public static final String INSTRUCTION_PACKAGE_TYPE_3_STR = "03";
	
	//----在线状态
	//在线
	public static final int INSTRUCTION_ONLINE_STATU_ONLINE = 0xBD;
	public static final String INSTRUCTION_ONLINE_STATU_ONLINE_STR = "BD";
	//故障
	public static final int INSTRUCTION_ONLINE_STATU_ERROR = 0xBF;
	public static final String INSTRUCTION_ONLINE_STATU_ERROR_STR = "BF";
	//离线
	public static final int INSTRUCTION_ONLINE_STATU_OFFLINE = 0xFE;
	public static final String INSTRUCTION_ONLINE_STATU_OFFLINE_STR = "FE";
	
	//----闲忙标识
	//忙，等待
	public static final int INSTRUCTION_BUSY_FLAG_BUSY = 0x11;
	public static final String INSTRUCTION_BUSY_FLAG_BUSY_STR = "11";
	//闲，可查询
	public static final int INSTRUCTION_BUSY_FLAG_IDLE = 0x67;
	public static final String INSTRUCTION_BUSY_FLAG_IDLE_STR = "67";
	
	/**
	 * 发送指令常量
	 */
	//发送指令间隔时间
	public static final int INSTRUCTION_SEND_SLEEP_TIME = 500;
	//盲添指令间隔时间
	public static final int INSTRUCTION_MIND_ADD_SLEEP_TIME = 30*1000;
	//发送学习指令超时时间
	public static final int INSTRUCTION_STUDY_TIME_OUT = 1000*10;
	
	
	//发送，接收每条指令的字节长度
	public static final int INSTRUCTIOIN_BYTES_LENGTH = 19;
	
	//广播打开灯类设备
	public static final int[] INSTRUCTION_BROADCAST_OPEN_ALL_LIGHT = new int[]{
		0xFF,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x35,0x46,0x00,0x23,0x03,0xAD
	};
	public static final String INSTRUCTION_BROADCAST_OPEN_ALL_LIGHT_str = "FF00120000000000000000FFFF3546002303AD";
	
	//广播关闭灯类设备
	public static final int[] INSTRUCTION_BROADCAST_CLOSE_ALL_LIGHT = new int[]{
		0xFF,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x35,0x46,0x00,0x23,0x02,0xAE
	};
	public static final String INSTRUCTION_BROADCAST_CLOSE_ALL_LIGHT_STR = "FF00120000000000000000FF003546002302AE";
	
	//错误指令ERRO
	public static final int[] INSTRUCTION_ERRO = new int[]{
		0x45,0x52,0x52,0x4F,0x45,0x52,0x52,0x4F,0x45,0x52,0x52,0x4F,0x45,0x52,0x52,0x4F,0x45,0x52,0x52
	};
	public static final String INSTRUCTION_ERRO_STR = "4552524F4552524F4552524F4552524F455252";
	
	//校对指令
	public static final int[] INSTRUCTION_PROOFREADING = new int[]{
		0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00
	};
	//00000000000000000000000000000000000000
	//FF001200000000000000000000000000000011FF00020000000100000200010300020400000EFF010205000006000007000008000009000025FF02020A00000B00000C00000D00000E00003FFF03020F000010000011000012000013000059FF040214000015000016000017000018000073FF05021900001A00001B00001C00001D00008DFF06031E00001F0000200000210000220000A8
	public static final String INSTRUCTION_PROOFREADING_STR = "00000000000000000000000000000000000000";
	
	//繁忙指令
	public static final int[] INSTRUCTION_BUSY = new int[]{
		0x42,0x55,0x53,0x59,0x42,0x55,0x53,0x59,0x42,0x55,0x53,0x59,0x42,0x55,0x53,0x59,0x42,0x55,0x53
	};
	public static final String INSTRUCTION_BUSY_STR = "42555359425553594255535942555359425553"; 
	
	//OK指令
//	public static final int[] INSTRUCTION_OK = new int[]{
//		0x4F,0x4B,0x4F,0x4B,0x4F,0x4B,0x4F,0x4B,0x4F,0x4B,0x4F,0x4B,0x4F,0x4B,0x4F,0x4B,0x4F,0x4B,0x4F
//	};
//	public static final String INSTRUCTION_OK_STR = "4F4B4F4B4F4B4F4B4F4B4F4B4F4B4F4B4F4B4F";
	
	//失败指令
	public static final int[] INSTRUCTION_FAIL = new int[]{
		0x46,0x41,0x49,0x4C,0x46,0x41,0x49,0x4C,0x46,0x41,0x49,0x4C,0x46,0x41,0x49,0x4C,0x46,0x41,0x49
	};
	public static final String INSTRUCTION_FAIL_STR = "4641494C4641494C4641494C4641494C464149";

	
	//盲添指令
	public static final int[] INSTRUCTION_ADD_ALL = new int[]{
		0xFF,0x00,0x12,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x10
	};
	public static final String INSTRUCTION_ADD_ALL_STR = "FF001200000000FF0000000000000000000210";
	
	//添加单个
	public static final int[] INSTRUCTION_ADD_ONE = new int[]{
		0xFF,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x12
	};
	public static final String INSTRUCTION_ADD_ONE_STR = "FF001200000000000100000000000000000112";
	
	
	//复位所有设备
	public static final int[] INSTRUCTION_RESET_ALL = new int[]{
		0xFF,0x00,0x12,0x00,0x03,0x00,0x00,0x00,0x00,0xDF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xF3
	};
	public static final String INSTRUCTION_RESET_ALL_STR = "FF0012000300000000DF0000000000000001F3";
	
	//设备自动复位标识
	public static final String INSTRUCTION_DEVICE_AUTO_RESET = "6F6F6F6F";
	
	
	/**
	 * 	用户指令标识
	 */
	public static final String INSTRUCTION_FLAG_ADD_ALL = "ADDALL";
	public static final String INSTRUCTION_FLAG_ADD_ONE = "ADDONE";
	public static final String INSTRUCTION_FLAG_RESET_ALL = "RESETALL";
	public static final String INSTRUCTION_FLAG_RESET_ONE = "RESETONE";
	public static final String INSTRUCTION_FLAG_UPGRADE = "UPGRADE";
	public static final String INSTRUCTION_FLAG_SWITCH = "SWITCH";
	public static final String INSTRUCTION_FLAG_ADJUST = "ADJUST";
	public static final String INSTRUCTION_FLAG_QUERY = "QUERY";
	public static final String INSTRUCTION_FLAG_SET_CHECK_TIME = "SETCHECKTIME";
	public static final String INSTRUCTION_FLAG_READ = "READ";
	public static final String INSTRUCTION_FLAG_SCENESWITCH = "SCENESWITCH";
	public static final String INSTRUCTION_FLAG_INFRARED_CONTROL = "CONTROL";//控制指令
	public static final String INSTRUCTION_FLAG_INFRARED_STUDY = "STUDY";	//学习指令
	
	public static final String INSTRUCTION_FLAG_OPEN_ONE = "OPENONE";
	public static final String INSTRUCTION_FLAG_OPEN_ALL = "OPENALL";
	public static final String INSTRUCTION_FLAG_SETDIMMING = "SETDIMMING";
	public static final String INSTRUCTION_FLAG_STOP = "STOP";
	public static final String INSTRUCTION_FLAG_CLOSE_ONE = "CLOSEONE";
	public static final String INSTRUCTION_FLAG_CLOSE_ALL = "CLOSEALL";
	
	
	/**
	 * 指令发送结果
	 */
	//public static final String INSTRUCTION_RESULT_OK = "OK";
	public static final String INSTRUCTION_RESULT_ERRO = "ERRO";
	/**
	 * 指令执行结果
	 */
	public static final String INSTRUCTION_DO_RESULT_BUSY = "BUSY";
	public static final String INSTRUCTION_DO_RESULT_FAIL = "FAIL";
	public static final String INSTRUCTION_DO_RESULT_DATA = "DATA";
	
	/**
	 * 失败处理重发次数
	 */
	public static final int INSTRUCTION_RESENT_COUNT = 0;
	
	
	/**
	 * 根据设备类型获取设备通用名称
	 * @param deviceId 设备类型
	 * @return	设备通用名称
	 */
	public static String getDeviceName(String deviceId){
		String deviceName = null;
		int id = Integer.parseInt(deviceId, 16);
		switch (id) {
		case 0x01:
			deviceName = "普通灯";
			break;
		case 0x02:
			deviceName = "调光灯";
			break;
		case 0x03:
			deviceName = "灯座";
			break;
		case 0x04:
			deviceName = "窗帘";
			break;
		case 0x05:
			deviceName = "红外";
			break;
		case 0x06:
			deviceName = "探测器";
			break;
		case 0x07:
			deviceName = "空气质量";
			break;
		case 0x08:
			deviceName = "PM2.5";
			break;
		case 0x09:
			deviceName = "光照";
			break;
		case 0x0A:
			deviceName = "温湿度";
			break;
		case 0x0B:
			deviceName = "可燃气报警";
			break;
		case 0x0C:
			deviceName = "烟感报警";
			break;
		case 0x0D:
			deviceName = "人感灯报警";
			break;
		case 0x0E:
			deviceName = "门锁";
			break;
		case 0x0F:
			deviceName = "电源";
			break;
		case 0x10:
			deviceName = "情景开关";
			break;
		case 0x11:
			deviceName = "调光开关";
			break;
		case 0x12:
			deviceName = "风雨传感器";
			break;
		case 0x13:
			deviceName = "报警开关";
			break;
		case 0x14:
			deviceName = "紧急报警SOS";
			break;
		case 0x15:
			deviceName = "红外发射器";
			break;
		case 0x16:
			deviceName = "强电窗帘";
			break;
		case 0x17:
			deviceName = "门磁";
			break;
		case 0x18:
			deviceName = "探测器";
			break;
		case 0x19:
			deviceName = "插座";
			break;
        case 0x1A:
            deviceName = "1路普通开关";
             break;
        case 0x1B:
            deviceName = "2路普通开关";
             break;
        case 0x1C:
            deviceName = "3路普通开关";
             break;
        case 0x1D:
            deviceName = "4路普通开关";
             break;
        case 0x1E:
            deviceName = "1路调光开关";
             break;
		case 0x1F:
            deviceName = "2路调光开关";
			break;
		default:
			deviceName = "未知设备";
			break;
		}
		return deviceName;
	}
	
	/**
	 * 根据10进制整数获取长度为length的16进制编号字符串
	 * @param number	设备编号10进制整数值
	 * @param length	要生成的16进制的长度，不满的前面加0
	 * @return 16进制编号字符串
	 */
	public static String getNumberString(int number,int length){
		String numberStr;
		numberStr = Integer.toHexString(number);
		if(numberStr.length() < length){
			int numberLength = length - numberStr.length();
			for(int i = 0; i < numberLength ; i++){
				numberStr = "0"+numberStr;
			}
		}
		return numberStr.toUpperCase();
	}
	

	public static Map<String,String> getDeviceTypeMap(){
		if(DEVICE_TYPE_MAP == null){
			DEVICE_TYPE_MAP = new HashMap<String,String>();
			DEVICE_TYPE_MAP.put(ID_TYPE_NOMAL_LIGHT_STR, "普通灯");
			DEVICE_TYPE_MAP.put(ID_TYPE_DIMMING_LIGHT_STR, "调光灯");
			DEVICE_TYPE_MAP.put(ID_TYPE_LAMP_HOLDER_STR, "灯座");
			DEVICE_TYPE_MAP.put(ID_TYPE_CURTAIN_STR, "窗帘");
			DEVICE_TYPE_MAP.put(ID_TYPE_INFRARED_STR, "红外");
			DEVICE_TYPE_MAP.put(ID_TYPE_CARBON_DIOXIDE_STR, "探测器");
			DEVICE_TYPE_MAP.put(ID_TYPE_AIR_QUALITY_STR, "空气质量");
			DEVICE_TYPE_MAP.put(ID_TYPE_PM_25_STR, "PM2.5");
			DEVICE_TYPE_MAP.put(ID_TYPE_SUN_LIGHT_STR, "光照");
			DEVICE_TYPE_MAP.put(ID_TYPE_SENSOR_WIND_RAIN_STR, "风雨传感器");
			DEVICE_TYPE_MAP.put(ID_TYPE_TEMPERATURE_HUMIDITY_STR, "温湿度");
			DEVICE_TYPE_MAP.put(ID_TYPE_ALARM_COMBUSTIBLE_GAS_STR, "可燃气报警");
			DEVICE_TYPE_MAP.put(ID_TYPE_ALARM_SMOKE_STR, "烟感报警");
			DEVICE_TYPE_MAP.put(ID_TYPE_ALARM_PEOPLE_SENSE_STR, "人感报警");
			DEVICE_TYPE_MAP.put(ID_TYPE_DOOR_LOCK_STR, "门锁");
			DEVICE_TYPE_MAP.put(ID_TYPE_POWER_STR, "电源");
			DEVICE_TYPE_MAP.put(ID_TYPE_NORMAL_SWITCH_STR, "普通开关");
			DEVICE_TYPE_MAP.put(ID_TYPE_DIMMING_SWITCH_STR, "调光开关");
			DEVICE_TYPE_MAP.put(ID_TYPE_ALARM_SWITCH_STR, "报警开关");
			DEVICE_TYPE_MAP.put(ID_TYPE_ALARM_EMERGENCY_STR, "紧急报警");
			DEVICE_TYPE_MAP.put(ID_TYPE_HAND_HELD_STR, "红外发射器");
			DEVICE_TYPE_MAP.put(ID_TYPE_HIGH_VOLTAGE_ELECTRICAL_CURTAIN_STR, "强电窗帘");
			DEVICE_TYPE_MAP.put(ID_TYPE_SECURITY_EQUIPMENT_STR, "门磁");
			DEVICE_TYPE_MAP.put(ID_TYPE_CUSTOM_EQUIPMENT_01_STR, "探测器");
			DEVICE_TYPE_MAP.put(ID_TYPE_THE_SOCKET_STR, "插座");
			DEVICE_TYPE_MAP.put(ID_TYPE_ONE_CASE_NORMAL_SWITCH_STR, "1路普通开关");
            DEVICE_TYPE_MAP.put(ID_TYPE_TWO_CASE_NORMAL_SWITCH_STR, "2路普通开关");
            DEVICE_TYPE_MAP.put(ID_TYPE_THREE_CASE_NORMAL_SWITCH_STR, "3路普通开关");
            DEVICE_TYPE_MAP.put(ID_TYPE_FOUR_CASE_NORMAL_SWITCH_STR, "4路普通开关");
            DEVICE_TYPE_MAP.put(ID_TYPE_ONE_CASE_DIMMING_SWITCH_STR, "1路调光开关");
            DEVICE_TYPE_MAP.put(ID_TYPE_TWO_CASE_DIMMING_SWITCH_STR, "2路调光开关");
		}
		return DEVICE_TYPE_MAP;
	}
	

	public static Map<String,String> getDeviceMonitorMap(){
		if(DEVICE_MONITOR_MAP == null){
			DEVICE_MONITOR_MAP = new HashMap<String,String>();
			DEVICE_MONITOR_MAP.put(ID_TYPE_NOMAL_LIGHT_STR, "普通灯");
			DEVICE_MONITOR_MAP.put(ID_TYPE_DIMMING_LIGHT_STR, "调光灯");
			DEVICE_MONITOR_MAP.put(ID_TYPE_LAMP_HOLDER_STR, "灯座");
			DEVICE_MONITOR_MAP.put(ID_TYPE_CURTAIN_STR, "窗帘");
			DEVICE_MONITOR_MAP.put(ID_TYPE_INFRARED_STR, "红外");
			DEVICE_MONITOR_MAP.put(ID_TYPE_POWER_STR, "电源");
			DEVICE_MONITOR_MAP.put(ID_TYPE_NORMAL_SWITCH_STR, "普通开关");
			DEVICE_MONITOR_MAP.put(ID_TYPE_DIMMING_SWITCH_STR, "调光开关");
            DEVICE_MONITOR_MAP.put(ID_TYPE_ONE_CASE_NORMAL_SWITCH_STR, "1路普通开关");
            DEVICE_MONITOR_MAP.put(ID_TYPE_TWO_CASE_NORMAL_SWITCH_STR, "2路普通开关");
            DEVICE_MONITOR_MAP.put(ID_TYPE_THREE_CASE_NORMAL_SWITCH_STR, "3路普通开关");
            DEVICE_MONITOR_MAP.put(ID_TYPE_FOUR_CASE_NORMAL_SWITCH_STR, "4路普通开关");
            DEVICE_MONITOR_MAP.put(ID_TYPE_ONE_CASE_DIMMING_SWITCH_STR, "1路调光开关");
            DEVICE_MONITOR_MAP.put(ID_TYPE_TWO_CASE_DIMMING_SWITCH_STR, "2路调光开关");
			DEVICE_MONITOR_MAP.put(ID_TYPE_HIGH_VOLTAGE_ELECTRICAL_CURTAIN_STR, "强电窗帘");
			DEVICE_MONITOR_MAP.put(ID_TYPE_THE_SOCKET_STR, "插座");
		}
		return DEVICE_MONITOR_MAP;
	}

    public static Map<String,String> getMiltiWayMap(){
        if(MUILTIWAY_TYPE_MAP == null){
            MUILTIWAY_TYPE_MAP = new HashMap<String,String>();
            MUILTIWAY_TYPE_MAP.put(ID_TYPE_ONE_CASE_NORMAL_SWITCH_STR, "1路普通开关");
            MUILTIWAY_TYPE_MAP.put(ID_TYPE_TWO_CASE_NORMAL_SWITCH_STR, "2路普通开关");
            MUILTIWAY_TYPE_MAP.put(ID_TYPE_THREE_CASE_NORMAL_SWITCH_STR, "3路普通开关");
            MUILTIWAY_TYPE_MAP.put(ID_TYPE_FOUR_CASE_NORMAL_SWITCH_STR, "4路普通开关");
            MUILTIWAY_TYPE_MAP.put(ID_TYPE_ONE_CASE_DIMMING_SWITCH_STR, "1路调光开关");
            MUILTIWAY_TYPE_MAP.put(ID_TYPE_TWO_CASE_DIMMING_SWITCH_STR, "2路调光开关");
        }
        return MUILTIWAY_TYPE_MAP;
    }


	//系统布防Key名
	public static final String SYSTEM_KEY_NAME_ALARM_FLAG = "systemAlarmFlag";
}
